//
// Copyright (c) 2009 All Right Reserved
//
// vl
//
// 2018-12-01
// Contains ...
using LargoCommon.Interfaces;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Media;
namespace LargoPanels.Editor {
/// A base chart master.
public partial class LineSpace : FrameworkElement
{
#region Public properties - Cells
/// Gets or sets the track cells.
/// The track cells.
public List VoiceCells { get; set; }
#endregion
#region Public methods - Find cell
/// Gets voice cell.
/// The point.
/// The voice cell.
public VoiceCell GetVoiceCell(Point point) {
var cell = (from c in this.VoiceCells
where c.ContainsPoint(point)
select c).FirstOrDefault();
return cell;
}
/// Gets the cell.
/// The point.
/// Returns value.
public BaseCell GetCellAtMousePoint(Point point) {
var cell = (from c in this.VoiceCells
where c.ContainsPoint(point)
select c).FirstOrDefault();
return cell;
}
#endregion
#region Private methods - Make Cells
///
/// Resets the cells.
///
private void ResetCells() {
this.VoiceCells = new List();
}
///
/// Loads the lines.
///
/// The content lines.
private void MakeVoiceCells(List contentLines) {
//// this.Lines = contentLines;
this.NumberOfLines = contentLines.Count;
foreach (var line in contentLines) {
//// var cell = this.LineCells[line.LineIndex];
var cell = new VoiceCell(this, line.MainVoice) {
PenBrush = Brushes.Black,
ContentBrush = Brushes.WhiteSmoke,
Width = (2 * SeedSize.CurrentWidth) - SeedSize.BasicMargin,
Height = SeedSize.CurrentHeight - SeedSize.BasicMargin
};
this.VoiceCells.Add(cell);
}
}
#endregion
}
}